#ifndef GAMETYPES_H_
# define GAMETYPES_H_

# define IMG_X 40
# define IMG_Y 40
# define MAT_W 24
# define MAT_H 24
# define TAB_SIZE 7
# define TOW_SIZE 3
# define ENN_SIZE 1

# include <SDL/SDL.h>

/**
** @brief e_case defines the content of a block
*/

typedef struct      s_case
{
    int             x;
    int             y;
    int             manh;
    int             distt;
    int             total;
    struct s_case   *prev;
    struct s_case   *next;
} s_case;

typedef enum block
{
    B_EMPTY,                //Empty block
    B_ENTRY = '0',
    B_EXIT,
    B_ROAD_GROUND = 'a',    //Road with rock style
    B_ROAD_LAST,            //Stop the list of roads styles
    B_ROCK,
    B_TREE,
    B_GRASS = 'z'           //Not a road. Grass style.
} e_block;

typedef enum tow_enum
{
    T_LAMBDA,
    T_SIMPLE,
    T_RIFLE
} e_tow;

typedef struct      tow_list s_tow_list;
struct tow_list
{
    int             id;
    int             pos[2];
    int             level;
    e_tow           type;
    s_tow_list      *next;
};

typedef enum enn_enum
{
    E_LAMBDA,
} e_enn;

typedef struct      enn_list s_enn_list;
struct enn_list
{
    int             id;
    int             life;
    int             pos[2];
    int             prev[2];
    e_enn           type;
    s_case          *pathfinding;
    s_enn_list      *next;
};

typedef struct fifo s_fifo;
struct fifo{
    e_enn   type;
    int     life;
    int     delay;
    s_fifo  *next;
};

typedef struct      object
{
    SDL_Surface     *screen;
    SDL_Surface     *side;
    SDL_Surface     *img[TAB_SIZE];
    SDL_Surface     *tow[TOW_SIZE];
    SDL_Surface     *enn[ENN_SIZE];
    s_fifo          *fifo;
    e_tow           tow_type;
    s_tow_list      *tow_list;
    s_enn_list      *enn_list;
    char            mat[MAT_W][MAT_H];
    int             src[2];
    int             dst[2];
    int             mouse_pos[2];
    int             wave;
    unsigned int    life;
    unsigned int    gold;
    char            bpushd;
}                   s_object;

#endif /* !GAMETYPES_H_ */
